package com.neuedu.his.controller;

import com.neuedu.his.entity.User;
import com.neuedu.his.framework.servlet.BaseServlet;
import com.neuedu.his.service.LoginService;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * 项目：      his
 * 类名:       LoginController
 * 创建时间：  2020/12/24  13:58
 * 描述 :     登录
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      https://jshand.gitee.io
 * http://127.0.0.1:8080/his/login?type=login&username=admin&password=123331
 */
@WebServlet(urlPatterns = "/login")
public class LoginController extends BaseServlet {


    private LoginService loginService = new LoginService();


    public void login(HttpServletRequest request, HttpServletResponse response) throws IOException {

        User user = loginService.login(request);

//        Map map = new HashMap();
//        map.put("user",user);

        this.success(response,user);
    }

}
